# Maintainer: Balló György <ballogyor+arch at gmail dot com>
# Contributor: Tobias Bohrmann (PlainTextField) <honeypot.carbage@aechelon.de>
# Contributor: Bernd Prünster (JesusMcCloud) <aur@berndpruenster.org>

pkgname=gnome-latex
pkgver=3.44.0
pkgrel=1
pkgdesc='LaTeX editor for the GNOME desktop'
arch=('loong64' 'x86_64')
url='https://wiki.gnome.org/Apps/GNOME-LaTeX'
license=('GPL3')
depends=('gsettings-desktop-schemas' 'gspell' 'libgee' 'tepl')
makedepends=('appstream-glib' 'autoconf-archive' 'git' 'gtk-doc' 'gobject-introspection' 'intltool'
             'vala' 'yelp-tools')
optdepends=('texlive-core: build LaTeX documents')
options=('debug')
_commit=8083f0476247feb29afac2682ee640dd18b8a6cf  # tags/3.44.0^0
source=("git+https://gitlab.gnome.org/swilmet/gnome-latex.git#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/[^-]*-g/r&/;s/-/+/g'
}

prepare() {
  cd $pkgname
  NOCONFIGURE=1 ./autogen.sh
}

build() {
  cd $pkgname
  ./configure --prefix=/usr --enable-gtk-doc
  make
}

check() {
  make -C $pkgname check
}

package() {
  cd $pkgname
  make DESTDIR="$pkgdir" install
}
